﻿using Qins.PluginInterface;
using System.Windows;

namespace Qins.Plugins.Hello
{
    public class HelloPlugin : IPlugin
    {
        public string PluginName => "HelloPlugin";
        public string Description { get => "Displays hello message."; }

        public string InDescription { get => "in a string."; }

        public string OutDescription { get => "return a string."; }

        public bool AutoRun { get => false; }

        public string Execute(object inPars)
        {
            try
            {
                //WindowHello wh= new WindowHello();
                //wh.Show();
                MessageBox.Show(inPars.ToString());
                return ("Hello!!!" + inPars?.ToString());
            }
            catch (Exception ex)
            {
                throw;
            }
            
        }

        public Message MessageTransport { get; set; }

        public void Initialization(Message messageTransport)
        {
            MessageTransport = messageTransport;
            //MessageTransport.Receive += CallPluginRun;//绑定接收方法
        }

        //public void CallPluginRun(string pluginName, string message)
        //{
        //    MessageTransport.SendMessage(pluginName, message);
        //}
    }
}